package mx.com.app.test;

public class ContinueWithLabelDemo {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		String searchMe = "Look ne for a substring in me ne";
        String substring = "ne";
        boolean foundIt = false;

        int max = searchMe.length() - substring.length();
        
        test:
        	for(int i = 0 ; i <= max; i++){
        		int n = substring.length();
        		int j = i;
        		int k = 0;
        		
        		while(n-- != 0){
        			if(searchMe.charAt(j++) != substring.charAt(k++)){
        				continue test;
        			}
        		}
        		foundIt = true;
        		break test;
        	}
        System.out.println(foundIt ? "FoundIt" : "Didn't foundIt");
	}

}
